import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import FinanceView from '@/views/FinanceView.vue'
import MyBookShelfView from '@/views/MyBookShelfView.vue'
import HistoryView from '@/views/HistoryView.vue'
import LawView from '@/views/LawView.vue'
import LiteratureView from '@/views/LiteratureView.vue'
import LoginView from '@/views/LoginView.vue'
import BookFriendView from '@/views/BookFriendView.vue'
import RegisterView from '@/views/RegisterView.vue'
import ScientificView from '@/views/ScientificView.vue'
import UserView from '@/components/UserView.vue'
import BookInfoView from '@/views/BookInfoView.vue'
import NotFoundView from '@/views/NotFoundView.vue'
import UserInfoView from '@/views/UserInfoView.vue'
import UserMessageView from '@/views/UserMessageView.vue'
import UserPeruseView from '@/views/UserPeruseView.vue'
import UserPostView from '@/views/UserPostView.vue'
import RecommendView from '@/views/RecommendView.vue'
import UserFavoriteView from '@/views/UserFavoriteView.vue'
import LaunchBookView from '@/views/LaunchBookView.vue'
import RemoveBookView from '@/views/RemoveBookView.vue'
import ManageStudentView from '@/components/ManageStudentView.vue'
import ManageAccountView from '@/views/ManageAccountView.vue'
import ManageDyanmicView from '@/views/ManageDyanmicView.vue'
import ManageRecentlyMessageView from '@/views/ManageRecentlyMessageView.vue'
import LikeEmptyView from '@/views/LikeEmptyView.vue'
import OrdinaryDialogueView from '@/views/OrdinaryDialogueView.vue'
import ConfirmReturnBookView from '@/views/ConfirmReturnBookView.vue'
import SearchBookView from '@/views/SearchBookView.vue'
import UserBorrowedBookView from '@/views/UserBorrowedBookView.vue'
import AdminSearchView from '@/views/AdminSearchView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/FinanceView/',
    name: 'finance',
    component: FinanceView
  },
  {
    path: '/MyBookShelfView/',
    name: 'mybookshelf',
    component: MyBookShelfView
  },
  {
    path: '/HistoryView/',
    name: 'history',
    component: HistoryView
  },
  {
    path: '/LawView/',
    name: 'law',
    component: LawView
  },
  {
    path: '/LiteratureView/',
    name: 'literature',
    component: LiteratureView
  },
  {
    path: '/LoginView/',
    name: 'login',
    component: LoginView
  },
  {
    path: '/BookFriendView/',
    name: 'bookfriend',
    component: BookFriendView
  },
  {
    path: '/RegisterView/',
    name: 'register',
    component: RegisterView
  },
  {
    path: '/ScientificView/',
    name: 'scientific',
    component: ScientificView
  },
  {
    path: '/UserView/',
    name: 'user',
    component: UserView
  },
  {
    path: '/BookInfoView/:bookid/',
    name: 'bookinfo',
    component: BookInfoView,
  },
  {
    path: '/NotFoundView/',
    name: 'notfound',
    component: NotFoundView,
  },
  {
    path: '/:catchAll(.*)',
    redirect: "/NotFoundView/"
  },
  {
    path: '/UserInfoView/',
    name: 'userinfo',
    component: UserInfoView
  },
  {
    path: '/UserPeruseView/',
    name: 'userperuse',
    component: UserPeruseView
  },
  {
    path: '/UserPostView/',
    name: 'userpost',
    component: UserPostView
  },
  {
    path: '/UserMessageView/',
    name: 'usermessage',
    component: UserMessageView
  },
  {
    path: '/RecommendView',
    name: 'recommend',
    component: RecommendView,
  },
  {
    path: '/UserFavoriteView',
    name: 'userfavorite',
    component: UserFavoriteView
  },
  {
    path: '/LaunchBookView',
    name: 'launchbook',
    component: LaunchBookView,
  },
  {
    path: '/RemoveBookView',
    name: "removebook",
    component: RemoveBookView,
  },
  {
    path: '/ManageStudentView',
    name: "managestudent",
    component: ManageStudentView,
  },
  {
    path: '/ManageAccountView',
    name: 'manageaccount',
    component: ManageAccountView,
  },
  {
    path: '/ManageDyanmicView',
    name: 'managedyanmic',
    component: ManageDyanmicView,
  },
  {
    path: '/ManageRecentlyMessageView',
    name: 'managerecentlymessage',
    component: ManageRecentlyMessageView,
  },
  {
    path: '/LikeEmptyView',
    name: 'likeempty',
    component: LikeEmptyView,
  },
  {
    path: '/OrdinaryDialogueView/:userid/',
    name: 'ordinarydialogue',
    component: OrdinaryDialogueView,
  },
  {
    path: '/ConfirmReturnBookView',
    name: 'confirmreturnbook',
    component: ConfirmReturnBookView,
  },
  {
    path: '/SearchBookView',
    name: 'searchbook',
    component: SearchBookView,
  },
  {
    path: '/UserBorrowedBookView',
    name: 'userborrowedbook',
    component: UserBorrowedBookView,
  },
  {
    path: '/AdminSearchView',
    name: 'adminsearch',
    component: AdminSearchView,
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
